//
//  AddedViewController.m
//  ControllerAndItsViewTest
//
//  Created by wangrui on 13-9-17.
//  Copyright (c) 2013年 PPS. All rights reserved.
//

#import "AddedViewController.h"

@interface AddedViewController ()

@end

@implementation AddedViewController

- (void)dealloc{
    NSLog(@"target dealloc");
    [super dealloc];
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    NSLog(@"%@",NSStringFromCGRect(self.view.frame));
    self.view.backgroundColor = [UIColor blueColor];
    
    UIButton *bt = [UIButton buttonWithType:UIButtonTypeContactAdd];
    [bt addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
    [bt setCenter:CGPointMake(20, 20)];
    [self.view addSubview:bt];
    
    NSLog(@"parenet:%p",self.parentViewController);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)test{
    NSLog(@"bt response");
}

- (BOOL)shouldAutorotate{
    return YES;
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)interval{
    NSLog(@"added rotate");
}


@end
